cmake_minimum_required(VERSION 3.15.1)

include(cmake/SparkWithGit.cmake)

project(com.gitee.xinghuo.note LANGUAGES C CXX VERSION 1.6.2)

spark_initialize_modules()

set(QRC_SOURCES "")

spark_add_executable_path(note
    note
)
target_link_qt(note)

spark_add_links_qt6(PrintSupport)
target_link_qt6_printsupport(note)

##
# [Desktop Entry] For Linux 
# 内容默认应用名称: Name= 应与项目名称相同
spark_desktop_macros(
    # 应用名称: Name=
    "note"
    # 应用名称: Name[zh_CN]=
    "便签大师"
    # 应用说明: Comment=
    "便签大师养成记"
    # 应用类型: Type=
    "Application"
    # 执行程序: Exec=
    "/opt/apps/${PROJECT_NAME}/bin/note"
    # 图标路径: Icon=
    "/opt/apps/${PROJECT_NAME}/icon/note.png"
    # 应用分类: Categories=
    "Application"
    # MIME类型: MimeType=
)
install(FILES ${SPARK_DESKTOP_FILE}
    DESTINATION /usr/share/applications
)
install(FILES note/note.png
    DESTINATION /opt/apps/${PROJECT_NAME}/icon
)
install(TARGETS note
    DESTINATION /opt/apps/${PROJECT_NAME}/bin
)

##
# [deb] For Linux(with dpkg)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
add_package_descript(cmake/spark-deb-package.descript)
